package com.itcncp.wechat.app.dao.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.itcncp.common.plugin.ToStringSerializer;

import java.io.Serializable;
import java.util.Date;

public class ItcsTerminalLinksRgt implements Serializable {
    private String connectId;

    @JSONField(serializeUsing= ToStringSerializer.class)
    private Long terminalNo;

    /**
     * 连接时间-消息类型1001
     *
     * @mbg.generated
     */
    private Date linkTime;

    /**
     * 收费公路编号
     *
     * @mbg.generated
     */
    private String tollRoadId;

    /**
     * 收费路段编号
     *
     * @mbg.generated
     */
    private String roadsectionId;

    /**
     * 收费站编号
     *
     * @mbg.generated
     */
    private String stationId;

    /**
     * 收费广场编号
     *
     * @mbg.generated
     */
    private String tollPlazaId;

    /**
     * 收费车道编号
     *
     * @mbg.generated
     */
    private String laneId;

    /**
     * 通信盒IP地址
     *
     * @mbg.generated
     */
    private String terminalIp;

    /**
     * 通信盒MAC地址
     *
     * @mbg.generated
     */
    private String terminalMac;

    private String localhost;

    private String port;

    /**
     * 最后一次心跳时间
     *
     * @mbg.generated
     */
    private Date linkHbTime;

    /**
     * 1：车道交易状态 2：车道不可交易状态 3：车道通信断开
     *
     * @mbg.generated
     */
    private Byte terminalStatus;

    private String terminalKey;

    private static final long serialVersionUID = 1L;

    public String getConnectId() {
        return connectId;
    }

    public void setConnectId(String connectId) {
        this.connectId = connectId;
    }

    public Long getTerminalNo() {
        return terminalNo;
    }

    public void setTerminalNo(Long terminalNo) {
        this.terminalNo = terminalNo;
    }

    public Date getLinkTime() {
        return linkTime;
    }

    public void setLinkTime(Date linkTime) {
        this.linkTime = linkTime;
    }

    public String getTollRoadId() {
        return tollRoadId;
    }

    public void setTollRoadId(String tollRoadId) {
        this.tollRoadId = tollRoadId;
    }

    public String getRoadsectionId() {
        return roadsectionId;
    }

    public void setRoadsectionId(String roadsectionId) {
        this.roadsectionId = roadsectionId;
    }

    public String getStationId() {
        return stationId;
    }

    public void setStationId(String stationId) {
        this.stationId = stationId;
    }

    public String getTollPlazaId() {
        return tollPlazaId;
    }

    public void setTollPlazaId(String tollPlazaId) {
        this.tollPlazaId = tollPlazaId;
    }

    public String getLaneId() {
        return laneId;
    }

    public void setLaneId(String laneId) {
        this.laneId = laneId;
    }

    public String getTerminalIp() {
        return terminalIp;
    }

    public void setTerminalIp(String terminalIp) {
        this.terminalIp = terminalIp;
    }

    public String getTerminalMac() {
        return terminalMac;
    }

    public void setTerminalMac(String terminalMac) {
        this.terminalMac = terminalMac;
    }

    public String getLocalhost() {
        return localhost;
    }

    public void setLocalhost(String localhost) {
        this.localhost = localhost;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }

    public Date getLinkHbTime() {
        return linkHbTime;
    }

    public void setLinkHbTime(Date linkHbTime) {
        this.linkHbTime = linkHbTime;
    }

    public Byte getTerminalStatus() {
        return terminalStatus;
    }

    public void setTerminalStatus(Byte terminalStatus) {
        this.terminalStatus = terminalStatus;
    }

    public String getTerminalKey() {
        return terminalKey;
    }

    public void setTerminalKey(String terminalKey) {
        this.terminalKey = terminalKey;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", connectId=").append(connectId);
        sb.append(", terminalNo=").append(terminalNo);
        sb.append(", linkTime=").append(linkTime);
        sb.append(", tollRoadId=").append(tollRoadId);
        sb.append(", roadsectionId=").append(roadsectionId);
        sb.append(", stationId=").append(stationId);
        sb.append(", tollPlazaId=").append(tollPlazaId);
        sb.append(", laneId=").append(laneId);
        sb.append(", terminalIp=").append(terminalIp);
        sb.append(", terminalMac=").append(terminalMac);
        sb.append(", localhost=").append(localhost);
        sb.append(", port=").append(port);
        sb.append(", linkHbTime=").append(linkHbTime);
        sb.append(", terminalStatus=").append(terminalStatus);
        sb.append(", terminalKey=").append(terminalKey);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ItcsTerminalLinksRgt other = (ItcsTerminalLinksRgt) that;
        return (this.getConnectId() == null ? other.getConnectId() == null : this.getConnectId().equals(other.getConnectId()))
            && (this.getTerminalNo() == null ? other.getTerminalNo() == null : this.getTerminalNo().equals(other.getTerminalNo()))
            && (this.getLinkTime() == null ? other.getLinkTime() == null : this.getLinkTime().equals(other.getLinkTime()))
            && (this.getTollRoadId() == null ? other.getTollRoadId() == null : this.getTollRoadId().equals(other.getTollRoadId()))
            && (this.getRoadsectionId() == null ? other.getRoadsectionId() == null : this.getRoadsectionId().equals(other.getRoadsectionId()))
            && (this.getStationId() == null ? other.getStationId() == null : this.getStationId().equals(other.getStationId()))
            && (this.getTollPlazaId() == null ? other.getTollPlazaId() == null : this.getTollPlazaId().equals(other.getTollPlazaId()))
            && (this.getLaneId() == null ? other.getLaneId() == null : this.getLaneId().equals(other.getLaneId()))
            && (this.getTerminalIp() == null ? other.getTerminalIp() == null : this.getTerminalIp().equals(other.getTerminalIp()))
            && (this.getTerminalMac() == null ? other.getTerminalMac() == null : this.getTerminalMac().equals(other.getTerminalMac()))
            && (this.getLocalhost() == null ? other.getLocalhost() == null : this.getLocalhost().equals(other.getLocalhost()))
            && (this.getPort() == null ? other.getPort() == null : this.getPort().equals(other.getPort()))
            && (this.getLinkHbTime() == null ? other.getLinkHbTime() == null : this.getLinkHbTime().equals(other.getLinkHbTime()))
            && (this.getTerminalStatus() == null ? other.getTerminalStatus() == null : this.getTerminalStatus().equals(other.getTerminalStatus()))
            && (this.getTerminalKey() == null ? other.getTerminalKey() == null : this.getTerminalKey().equals(other.getTerminalKey()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getConnectId() == null) ? 0 : getConnectId().hashCode());
        result = prime * result + ((getTerminalNo() == null) ? 0 : getTerminalNo().hashCode());
        result = prime * result + ((getLinkTime() == null) ? 0 : getLinkTime().hashCode());
        result = prime * result + ((getTollRoadId() == null) ? 0 : getTollRoadId().hashCode());
        result = prime * result + ((getRoadsectionId() == null) ? 0 : getRoadsectionId().hashCode());
        result = prime * result + ((getStationId() == null) ? 0 : getStationId().hashCode());
        result = prime * result + ((getTollPlazaId() == null) ? 0 : getTollPlazaId().hashCode());
        result = prime * result + ((getLaneId() == null) ? 0 : getLaneId().hashCode());
        result = prime * result + ((getTerminalIp() == null) ? 0 : getTerminalIp().hashCode());
        result = prime * result + ((getTerminalMac() == null) ? 0 : getTerminalMac().hashCode());
        result = prime * result + ((getLocalhost() == null) ? 0 : getLocalhost().hashCode());
        result = prime * result + ((getPort() == null) ? 0 : getPort().hashCode());
        result = prime * result + ((getLinkHbTime() == null) ? 0 : getLinkHbTime().hashCode());
        result = prime * result + ((getTerminalStatus() == null) ? 0 : getTerminalStatus().hashCode());
        result = prime * result + ((getTerminalKey() == null) ? 0 : getTerminalKey().hashCode());
        return result;
    }
}